﻿Imports System.Runtime.Serialization

''' <summary>
''' JOS客户端异常。
''' </summary>
Public Class JosException
    Inherits Exception
    Private m_errorCode As String
    Private m_errorMsg As String

    Public Sub New()
        MyBase.New()
    End Sub

    Public Sub New(ByVal message As String)
        MyBase.New(message)
    End Sub

    Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
        MyBase.New(info, context)
    End Sub

    Public Sub New(ByVal message As String, ByVal innerException As Exception)
        MyBase.New(message, innerException)
    End Sub

    Public Sub New(ByVal errorCode As String, ByVal errorMsg As String)
        MyBase.New(errorCode & ":" & errorMsg)
        Me.m_errorCode = errorCode
        Me.m_errorMsg = errorMsg
    End Sub

    Public ReadOnly Property ErrorCode() As String
        Get
            Return Me.m_errorCode
        End Get
    End Property

    Public ReadOnly Property ErrorMsg() As String
        Get
            Return Me.m_errorMsg
        End Get
    End Property

End Class